//引入第三方包
const express = require('express')
const expressJoi = require('@escook/express-joi')

//引入自定义包
const userHandler = require('../router_handler/user')
const userRuler = require('../schema/user')

//创建实例路由对象
const router = express.Router()

//挂载用户登录路由
//传入局部中间件，添加账号密码验证规则
router.post('/login', expressJoi(userRuler), userHandler.handleLogin)

//挂载用户注册路由
//传入局部中间件，添加账号密码验证规则
router.post('/reguser', expressJoi(userRuler), userHandler.handleReguser)


module.exports = router